Optimal. Leaf size=85 \[ \frac{b^3 B \log (a \cos (c+d x)+b \sin (c+d x))}{a^2 d \left (a^2+b^2\right )}-\frac{a B x}{a^2+b^2}-\frac{b B \log (\sin (c+d x))}{a^2 d}-\frac{B \cot (c+d x)}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.182393, antiderivative size = 85, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.147, Rules used = {21, 3569, 3651, 3530, 3475} \[ \frac{b^3 B \log (a \cos (c+d x)+b \sin (c+d x))}{a^2 d \left (a^2+b^2\right )}-\frac{a B x}{a^2+b^2}-\frac{b B \log (\sin (c+d x))}{a^2 d}-\frac{B \cot (c+d x)}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 3569
Rule 3651
Rule 3530
Rule 3475
Rubi steps
\begin{align*} \int \frac{\cot ^2(c+d x) (a B+b B \tan (c+d x))}{(a+b \tan (c+d x))^2} \, dx &=B \int \frac{\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx\\ &=-\frac{B \cot (c+d x)}{a d}-\frac{B \int \frac{\cot (c+d x) \left (b+a \tan (c+d x)+b \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{a}\\ &=-\frac{a B x}{a^2+b^2}-\frac{B \cot (c+d x)}{a d}-\frac{(b B) \int \cot (c+d x) \, dx}{a^2}+\frac{\left (b^3 B\right ) \int \frac{b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a^2 \left (a^2+b^2\right )}\\ &=-\frac{a B x}{a^2+b^2}-\frac{B \cot (c+d x)}{a d}-\frac{b B \log (\sin (c+d x))}{a^2 d}+\frac{b^3 B \log (a \cos (c+d x)+b \sin (c+d x))}{a^2 \left (a^2+b^2\right ) d}\\ \end{align*}
Mathematica [C] time = 0.387123, size = 97, normalized size = 1.14 \[ -\frac{B \left (-\frac{b^3 \log (a \cot (c+d x)+b)}{a^2 \left (a^2+b^2\right )}-\frac{\log (-\cot (c+d x)+i)}{2 (b+i a)}+\frac{\log (\cot (c+d x)+i)}{2 (-b+i a)}+\frac{\cot (c+d x)}{a}\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.081, size = 117, normalized size = 1.4 \begin{align*}{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) Bb}{2\,d \left ({a}^{2}+{b}^{2} \right ) }}-{\frac{B\arctan \left ( \tan \left ( dx+c \right ) \right ) a}{d \left ({a}^{2}+{b}^{2} \right ) }}-{\frac{B}{ad\tan \left ( dx+c \right ) }}-{\frac{\ln \left ( \tan \left ( dx+c \right ) \right ) Bb}{{a}^{2}d}}+{\frac{{b}^{3}\ln \left ( a+b\tan \left ( dx+c \right ) \right ) B}{{a}^{2}d \left ({a}^{2}+{b}^{2} \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.75692, size = 142, normalized size = 1.67 \begin{align*} \frac{\frac{2 \, B b^{3} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{4} + a^{2} b^{2}} - \frac{2 \,{\left (d x + c\right )} B a}{a^{2} + b^{2}} + \frac{B b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac{2 \, B b \log \left (\tan \left (d x + c\right )\right )}{a^{2}} - \frac{2 \, B}{a \tan \left (d x + c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.84326, size = 347, normalized size = 4.08 \begin{align*} -\frac{2 \, B a^{3} d x \tan \left (d x + c\right ) - B b^{3} \log \left (\frac{b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right ) + 2 \, B a^{3} + 2 \, B a b^{2} +{\left (B a^{2} b + B b^{3}\right )} \log \left (\frac{\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )}{2 \,{\left (a^{4} + a^{2} b^{2}\right )} d \tan \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.28116, size = 165, normalized size = 1.94 \begin{align*} \frac{\frac{2 \, B b^{4} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{4} b + a^{2} b^{3}} - \frac{2 \,{\left (d x + c\right )} B a}{a^{2} + b^{2}} + \frac{B b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac{2 \, B b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{2}} + \frac{2 \,{\left (B b \tan \left (d x + c\right ) - B a\right )}}{a^{2} \tan \left (d x + c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]